import request from "@/request/";

export const getDictBizList = (params) => {
  return request({
    url: "/api/trio-system/dict-biz/parent-list",
    method: "get",
    params: {
      ...params,
    },
  });
};

export const getDictChildList = (params) => {
  return request({
    url: "/api/trio-system/dict-biz/child-list",
    method: "get",
    params: {
      ...params,
    },
  });
};

export const addDict = (row) => {
  return request({
    url: "/api/trio-system/dict-biz/submit",
    method: "post",
    data: row,
  });
};

export const removeDict = (ids) => {
  return request({
    url: "/api/trio-system/dict-biz/remove",
    method: "post",
    params: {
      ids,
    },
  });
};

export const updateDict = (row) => {
  return request({
    url: "/api/trio-system/dict-biz/submit",
    method: "post",
    data: row,
  });
};

export const getDictTree = () => {
  return request({
    url: "/api/trio-system/dict-biz/tree?code=DICT",
    method: "get",
  });
};

export const getDictionary = (params) => {
  return request({
    url: "/api/trio-system/dict-biz/dictionary",
    method: "get",
    params,
  });
};

export const getEnum = (keyList) => {
  return request({
    url: "/api/mes-production-service/preset/enum/list",
    method: "POST",
    data: {
      keyList,
    },
  });
};
